package com.cl.pile.rule.filter;

/**
 * @author chenyitao
 * @date 2021/3/4
 */
public class InContainsFilterOperation extends BaseContentOperation implements IFilterOperation{
    @Override
    public boolean filterMatch(Object value, String matchValue) {
        if (value == null || matchValue == null) {
            return false;
        }

        String[] matchValues = matchValue.split(",");
        for (String val : matchValues) {
            if (replaceSpace(String.valueOf(value)).contains(val)) {
                return true;
            }
        }
        return false;
    }

    @Override
    public String filterName() {
        return "列表包含（或）";
    }
}
